<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="LProjectApprove" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
    <typeAlias alias="LProjectApprove" type="EIA.PM.Model.LProjectApprove, EIA.PM.Model" />
</alias>

<resultMaps>
<resultMap id="select-lprojectapprove-result" class="LProjectApprove">
<constructor>
    <argument argumentName="app_id" column="app_id"/>
    <argument argumentName="prj_id" column="prj_id"/>
    <argument argumentName="progress" column="progress"/>
    <argument argumentName="step_state" column="step_state"/>
    <argument argumentName="step1_staff" column="step1_staff"/>
    <argument argumentName="step1_content" column="step1_content"/>
    <argument argumentName="step1_date" column="step1_date"/>
    <argument argumentName="step2_staff" column="step2_staff"/>
    <argument argumentName="step2_content" column="step2_content"/>
    <argument argumentName="step2_date" column="step2_date"/>
    <argument argumentName="step3_staff" column="step3_staff"/>
    <argument argumentName="step3_content" column="step3_content"/>
    <argument argumentName="step3_date" column="step3_date"/>
    <argument argumentName="step4_staff" column="step4_staff"/>
    <argument argumentName="step4_content" column="step4_content"/>
    <argument argumentName="step4_date" column="step4_date"/>
</constructor>
<!--
    <result property="AppId" column="app_id"/>
    <result property="PrjId" column="prj_id"/>
    <result property="Progress" column="progress"/>
    <result property="StepState" column="step_state"/>
    <result property="Step1Staff" column="step1_staff"/>
    <result property="Step1Content" column="step1_content"/>
    <result property="Step1Date" column="step1_date"/>
    <result property="Step2Staff" column="step2_staff"/>
    <result property="Step2Content" column="step2_content"/>
    <result property="Step2Date" column="step2_date"/>
    <result property="Step3Staff" column="step3_staff"/>
    <result property="Step3Content" column="step3_content"/>
    <result property="Step3Date" column="step3_date"/>
    <result property="Step4Staff" column="step4_staff"/>
    <result property="Step4Content" column="step4_content"/>
    <result property="Step4Date" column="step4_date"/>
-->
</resultMap>
</resultMaps>

<statements>
<sql id="sql_LProjectApprove_where_pk">
WHERE app_id=#AppId#
</sql>

<sql id="sql_LProjectApprove_where_cv">
<dynamic prepend="WHERE">
    <isPropertyAvailable property="AppId" prepend="AND">app_id=#AppId#</isPropertyAvailable>
    <isPropertyAvailable property="PrjId" prepend="AND">prj_id=#PrjId#</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend="AND">progress=#Progress#</isPropertyAvailable>
    <isPropertyAvailable property="StepState" prepend="AND">step_state=#StepState#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Staff" prepend="AND">step1_staff=#Step1Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Content" prepend="AND">step1_content LIKE concat('%', #Step1Content#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="Step1Date" prepend="AND">step1_date=#Step1Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Staff" prepend="AND">step2_staff=#Step2Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Content" prepend="AND">step2_content LIKE concat('%', #Step2Content#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="Step2Date" prepend="AND">step2_date=#Step2Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Staff" prepend="AND">step3_staff=#Step3Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Content" prepend="AND">step3_content LIKE concat('%', #Step3Content#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="Step3Date" prepend="AND">step3_date=#Step3Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Staff" prepend="AND">step4_staff=#Step4Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Content" prepend="AND">step4_content LIKE concat('%', #Step4Content#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="Step4Date" prepend="AND">step4_date=#Step4Date#</isPropertyAvailable>
</dynamic>
</sql>

<sql id="sql_LProjectApprove_set_cols">
<dynamic prepend="SET">
    <isPropertyAvailable property="PrjId" prepend=",">prj_id=#PrjId#</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend=",">progress=#Progress#</isPropertyAvailable>
    <isPropertyAvailable property="StepState" prepend=",">step_state=#StepState#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Staff" prepend=",">step1_staff=#Step1Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Content" prepend=",">step1_content=#Step1Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Date" prepend=",">step1_date=#Step1Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Staff" prepend=",">step2_staff=#Step2Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Content" prepend=",">step2_content=#Step2Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Date" prepend=",">step2_date=#Step2Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Staff" prepend=",">step3_staff=#Step3Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Content" prepend=",">step3_content=#Step3Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Date" prepend=",">step3_date=#Step3Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Staff" prepend=",">step4_staff=#Step4Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Content" prepend=",">step4_content=#Step4Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Date" prepend=",">step4_date=#Step4Date#</isPropertyAvailable>
</dynamic>
</sql>

<select id="SelectLProjectApprove" parameterClass="" resultMap="LProjectApprove.select-lprojectapprove-result">
SELECT *
FROM l_project_approve
<include refid="sql_LProjectApprove_where_pk"/><!--where-->
</select>

<select id="SelectLProjectApprove_CV" parameterClass="System.Collections.IDictionary" resultMap="LProjectApprove.select-lprojectapprove-result">
SELECT *
FROM l_project_approve
<include refid="sql_LProjectApprove_where_cv"/><!--where-->
</select>

<insert id="InsertLProjectApprove" parameterClass="LProjectApprove">
<!--pre selectKey place-->
INSERT INTO l_project_approve(
<dynamic prepend=" ">
    <isPropertyAvailable property="PrjId" prepend=",">prj_id</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend=",">progress</isPropertyAvailable>
    <isPropertyAvailable property="StepState" prepend=",">step_state</isPropertyAvailable>
    <isPropertyAvailable property="Step1Staff" prepend=",">step1_staff</isPropertyAvailable>
    <isPropertyAvailable property="Step1Content" prepend=",">step1_content</isPropertyAvailable>
    <isPropertyAvailable property="Step1Date" prepend=",">step1_date</isPropertyAvailable>
    <isPropertyAvailable property="Step2Staff" prepend=",">step2_staff</isPropertyAvailable>
    <isPropertyAvailable property="Step2Content" prepend=",">step2_content</isPropertyAvailable>
    <isPropertyAvailable property="Step2Date" prepend=",">step2_date</isPropertyAvailable>
    <isPropertyAvailable property="Step3Staff" prepend=",">step3_staff</isPropertyAvailable>
    <isPropertyAvailable property="Step3Content" prepend=",">step3_content</isPropertyAvailable>
    <isPropertyAvailable property="Step3Date" prepend=",">step3_date</isPropertyAvailable>
    <isPropertyAvailable property="Step4Staff" prepend=",">step4_staff</isPropertyAvailable>
    <isPropertyAvailable property="Step4Content" prepend=",">step4_content</isPropertyAvailable>
    <isPropertyAvailable property="Step4Date" prepend=",">step4_date</isPropertyAvailable>
</dynamic>
)VALUES(
<dynamic prepend=" ">
    <isPropertyAvailable property="PrjId" prepend=",">#PrjId#</isPropertyAvailable>
    <isPropertyAvailable property="Progress" prepend=",">#Progress#</isPropertyAvailable>
    <isPropertyAvailable property="StepState" prepend=",">#StepState#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Staff" prepend=",">#Step1Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Content" prepend=",">#Step1Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step1Date" prepend=",">#Step1Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Staff" prepend=",">#Step2Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Content" prepend=",">#Step2Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step2Date" prepend=",">#Step2Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Staff" prepend=",">#Step3Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Content" prepend=",">#Step3Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step3Date" prepend=",">#Step3Date#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Staff" prepend=",">#Step4Staff#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Content" prepend=",">#Step4Content#</isPropertyAvailable>
    <isPropertyAvailable property="Step4Date" prepend=",">#Step4Date#</isPropertyAvailable>
</dynamic>
)
<selectKey resultClass="int" type="post" property="AppId" >
SELECT LAST_INSERT_ID()
</selectKey>
</insert>

<update id="UpdateLProjectApprove" parameterClass="System.Collections.IDictionary">
UPDATE l_project_approve
<include refid="sql_LProjectApprove_set_cols"/><!--set-->
<include refid="sql_LProjectApprove_where_pk"/><!--where-->
</update>

<delete id="DeleteLProjectApprove" parameterClass="">
DELETE FROM l_project_approve
<include refid="sql_LProjectApprove_where_pk"/><!--where-->
</delete>

<statement id="DeleteLProjectApprove_CV" parameterClass="LProjectApprove">
DELETE FROM l_project_approve
<include refid="sql_LProjectApprove_where_cv"/><!--where-->
</statement>

<delete id="ClearLProjectApprove">
DELETE FROM l_project_approve
</delete>
</statements>
</sqlMap>